package com.weirdor.mongo.exception.code;

/**
 * @Author werdor
 * @Date 2021/11/9 12:47 下午
 **/
public enum QueryErrorCode implements BaseErrorCode {

    ARGUMENT_ILLEGAL(400001001, "参数非法"),
    ARGUMENT_MISSING(400001002, "缺失参数"),
    ARGUMENT_FORMAT_ERROR(400001003, "参数格式错误"),;

    private int code;
    private String message;

    private QueryErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    /**
     * 在这可以决定怎么展示错误信息
     */
    @Override
    public String toString() {
        return code + "" + message;
    }
}
